﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:local="clr-namespace:SilverlightDebate" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" x:Class="SilverlightDebate.MainPage"
    d:DesignHeight="600" d:DesignWidth="800" mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="#FFDADCE0">
    	<Grid.DataContext>
    		<local:MainPageViewModel/>
    	</Grid.DataContext>
    	<i:Interaction.Triggers>
    		<i:EventTrigger>
    			<i:InvokeCommandAction x:Name="SetMEFPanel" Command="{Binding SetMEFPanelCommand}" CommandParameter="{Binding ElementName=MEFPanel, Mode=OneWay}"/>
    		</i:EventTrigger>
    	</i:Interaction.Triggers>
    	<Grid x:Name="MEFPanel" Background="White" Margin="0,22,0,0"/>
    	<Border VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment">
    		<StackPanel x:Name="MainControls" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
    			<ComboBox x:Name="cbXaps" HorizontalAlignment="Center" VerticalAlignment="Center" SelectedIndex="{Binding SelectedXapInListProperty}" ItemsSource="{Binding SilverlightXapList}"/>
    			<Button Content="Load" Width="75" Margin="7,0,0,0">
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="Click">
    						<i:InvokeCommandAction x:Name="LoadXap" Command="{Binding LoadXAPCommand}" CommandParameter="{Binding SelectedItem, ElementName=cbXaps}"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>
    			</Button>
    		</StackPanel>
    	</Border>
    </Grid>
</UserControl>
